//
//  UploadViewController.h
//  iFlickr
//
//  Created by 张 霄鹤 on 09-5-17.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "ProgressViewController.h"

@class ProgressViewController;

@interface UploadViewController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate,UIAlertViewDelegate>{
	NSMutableArray *imgs;
	UIImagePickerController *pickerController;
	UITableView *table;

	BOOL isUploading;
	
	/**
	 * 当前启动后，添加的第几张图片
	 */
	NSInteger picNumber;
	
	NSString *picTitle;
	
	ProgressViewController *progress;
	
	/**
	 * 照相按钮，对于不支持的比如 iPod Touch 那么这个应该使用 Disable
	 */
	IBOutlet UIBarButtonItem *btnCamera;
	
	NSThread *uploadThread;
}

@property(nonatomic, retain) IBOutlet UITableView *table;


-(void)reloadImages;

-(IBAction)takePhoto:(id)sender;

-(IBAction)takeCamera:(id)sender;

-(IBAction)sendPhotos:(id)sender;

-(void)uploadImpl:(id)notification;

-(void)notifyStatus:(id)arg;

-(void)stopUpload;

/**
 * 检查是否有需要上传的
 */
-(BOOL)haveNeedUpload;

/**
 * UIAlertViewDelegate 实现方法
 */
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

-(void)doImageWork:(NSIndexPath *)indexPath;

/**
 * 上传完毕或者任务取消的情况下，执行这个方法
 */
-(void)doFinish:(id)arg;

@end
